% --- guide0.tex --- % FWEB reference guide. Included either by guide.tex (stand-alone guide) % or fwebman.tex (the complete user's manual). \FWEB\ is available ^^[\>{FWEB}!obtaining] via anonymous guest \.{ftp} from Internet host \.{lyman.pppl.gov}, a Sun SparcStation running \Unix. Use binary mode to transfer a compressed \.{tar} file with a name like \.{fweb-1.30.tar.Z}. See the file \.{/pub/fweb/READ\_ME} for the current status, recent bug reports, and further instructions. For those without \.{ftp} access, it is possible to emulate the function of~\.{ftp} by sending a valid \.{ftp} session as a mail message to \.{bitftp@pucc.bitnet}. The requested files will be returned by mail, possible \.{uuencode}d and broken up into several parts if they are sufficiently long. A sample \.{ftp} session is {\codemode ftp lyman.pppl.gov cd /pub/fweb get READ_ME \noindent To learn more about the \.{bitftp} service, send a message containing the single word ``\.{help}'' to the above address. To unpack the \.{tar} file, say {\codemode uncompress fweb-1.30.tar tar -xvf fweb-1.30.tar A brief summary of the installation procedure can be found in the \.{READ\_ME.FWEB} file included in the subdirectory corresponding to the numbered release---e.g., \.{/pub/fweb/v1.30/READ\_ME.FWEB}. \Unix\ users should do the following: {\codemode cd fweb-1.30 ./configure cd web make bootstrap make install More detailed installation information can be found in the separate file \.{INSTALL\_FWEB.tex} ^^:\>{INSTALL\UL FWEB.tex}: included with the \FWEB\ release in the \.{manual} subdirectory. \vfill\Eject % ------------------------------ SYNTAX SUMMARY ------------------------------ \def\sectionbreak{\filbreak\bigskip} \appendix L: SYNTAX SUMMARY.[][19.12.20] ^^(syntax!summary( Here we summarize various of the important features of \FWEB. This material is intended to be for reference; please refer to the body of the user's manual for full details. ^^[syntax!summary] \parskip=0pt plus1pt \long\def\summarize#1#2#3\par#4\par{\par{% \def\[##1]{[\.{##1}]}\def\(##1){(##1)}% \def\snext{#3} \ifx\snext\empty\def\starttext{} \else\def\starttext{#3\medskip}\fi \subsubsection #1.\par\starttext \abovedisplayskip=0pt plus1pt $$\vbox{\halign{\quad\tt##\hfil&--- \ \vtop{\hsize=#2\hsize\noindent\hang\strut\ignorespaces##\strut}\hfil\cr #4}}$$}} \def\Item{\itemitem{$\bullet$}} ^^{\>{WEB}!phases of} \summarize{The \FWEB\ processors}{0.7} FTANGLE & \It{Creates compilable code}.\endgraf \medskip \leftline{\bf Phase one:}^^{phase!1} \Item discards \TeX\ documentation; \Item tokenizes source; \Item expands~\.{@'\dots'}, \.{@"\dots"}, and \.{0b\It{binary}} (also \.{0\It{octal}} and \.{0x\It{hex}} in \Fortran); \Item stores code text in appropriate modules; \Item memorizes macro definitions (\.{@d} and~\.{@m}).\endgraf \medskip \leftline{\bf Phase two:}^^{phase!2} \Item outputs outer macro definitions (\.{@d}); \Item outputs the unnamed module (\.{@a}); \Item expands \WEB\ macros (\.{@m}); \Item expands build-in macros; \Item translates \Ratfor\ statements.\endgraf FWEAVE & \It{Typesets the documentation and code}.\endgraf \medskip \leftline{\bf Phase one:}^^{phase!1} \Item tokenizes and stores identifiers and module names; \Item collects cross-reference information (including processing~\.{@[} and~\.{@\`}); \Item stores limbo text definitions (\.{@l}); \Item collects information about overloaded operators~(\.{@v}) and identifiers~(\.{@W}).\endgraf \medskip \leftline{\bf Phase two:}^^{phase!2} \Item outputs limbo text; \Item outputs special \TeX\ macros for overloaded operators; \Item copies \TeX\ material directly to output; \Item treats material between vertical bars (\.{|\dots|}) as code to be typeset; \Item tokenizes and stores contents of each code section; \Item analyzes code syntax and converts to appropriate \TeX\ macros.\endgraf \medskip \leftline{\bf Phase three:}^^{phase!3} \Item typesets index and module cross-references; \Item writes table of contents.\endgraf \def\Oname(#1,#2){\It{name}.#1 {\rm (}#2{\rm)}} \summarize{Files}{0.7} The \FWEB\ system works with a variety of files. File names have the form \It{[path]}\./\It{root}\It{[.ext]}. Here '\./' is called the \\{PREFIX\_END\_CHAR}. ^^:\>{PREFIX\UL END\UL CHAR}: Since it differs for various operating systems, it can be changed in \.{custom.h}. ^^{customizing!directory path specifications} ^^{\>{custom.h}} The character that initiates the file-name extension (normally a period) can be changed with the `\.{-E}'~command-line option. ^^{\={-e}{-E}} \subheading{Input files:} \It{null file}&The system sometimes reads from the null file. This name varies from system to system; the default can be defined in \.{custom.h}, or it can be changed with the style-file parameter \.{null\_file}. ^^{file!null} ^^{customizing!null-file name} ^^{style file!vocabulary!\>{null\UL file}}\cr .fweb{\rm\ (or }fweb.ini{\rm)} & Initialization file; always in the \It{home} directory. ^^{directory!home} The basic file name can be overridden by the environment variable \.{FWEB\_INI}. ^^{\>{FWEB\UL INI}} (It can also be changed in \.{custom.h}, although this is strongly discouraged.)\cr fweb.sty & Style file; in \It{current} directory ^^{directory!current} unless overridden by environment variable \.{FWEB\_STYLE\_DIR}. ^^{\>{FWEB\UL STYLE\UL DIR}} The basic name can be changed by the `\.{-z}'~option. ^^{\>{-z}} (It can also be changed in \.{custom.h}, although this is strongly discouraged.)\cr \It{name}.web & Source code. (Alternative suffixes can be searched for automatically with the `\.{-e}'~option and the \.{ext.web} style-file entry.) ^^{\>{-e}} ^^{style file!vocabulary!\>{ext.web}}\cr \It{name}.ch & Change file. (Suffixes are treated as above, but see \.{ext.change}.) ^^{style file!vocabulary!\>{ext.change}}\cr \It{name}.hweb & Code included into \.{web} file with~\atcmd{i}. Include files are searched for in the path set by the environment variable \.{FWEB\_INCLUDES} ^^{\>{FWEB\UL INCLUDES}} ^^{path!for include files} and/or the \.{-I}~option; ^^{\={-i}{-I}} if that path is empty, then the current directory is searched. (Suffixes are treated as above, but see \.{ext.hweb}.) ^^{style file!vocabulary!\>{ext.hweb}}\cr \It{name}.hch & Change file for include file. (Suffixes are treated as above, but see \.{ext.hchange}.) ^^{style file!vocabulary!\>{ext.hchange}}\cr \subheading{Output files:} \It{name}.tex & Woven output; can be processed with either Plain \TeX\ or \LaTeX.\cr \noalign{\smallskip} CONTENTS.tex & Accumulates table-of-contents information written by \FWEAVE. (This name can be overridden by the style-file option \.{contents.tex}.) ^^{\>{CONTENTS.tex}} ^^{style file!vocabulary!\>{contents.tex}}\cr INDEX.tex & Stores indexing information written by \FWEAVE. (This name can be overridden by the style-file option \.{index.tex}.) ^^{\>{INDEX.tex}} ^^{style file!vocabulary!\>{index.tex}}\cr MODULES.tex & Stores module list written by \FWEAVE. (This name can be overridden by the style-file option \.{modules.tex}.) ^^{\>{MODULES.tex}} ^^{style file!vocabulary!\>{modules.tex}}\cr \noalign{\smallskip} \It{name.ext} & Compilable output file; see table below for the extension associated with each language.\cr \indent When the `\.{-e}'~option is in effect, ^^{\>{-e}} input file names that include no period are completed automatically according to the style-file entries listed in the following table: ^^:file name!extensions: $$\vbox{\offinterlineskip \halign{\vrule\vrule#&\strut\quad#\quad\hfil&\vrule#&\hfil\quad\tt#\quad\hfil &\vrule#&\hfil\quad\tt#\quad\hfil&\vrule\vrule#\cr\tablerule\tablerule &\It{Type of file}&&\It{Style-file entry}&&\It{Default}&\cr \tablerule\tablerule &\WEB\ file&&ext.web&&.web&\cr\tablerule &Change file&&ext.ch&&.ch&\cr\tablerule &Include file&&ext.hweb&&.hweb&\cr\tablerule &$\vcenter{\hbox{\strut Change file}\hbox{for include file\strut}}$&&ext.hch&&.hch&\cr \tablerule\tablerule The default extension for the file(s) output by \FTANGLE\ sometimes depends on whether the operating system is \Unix\ or not. (These defaults can be overridden by style-file parameters, as indicated.) ^^{extensions!file-name} ^^{style file!vocabulary!\>{suffix.C}} ^^{style file!vocabulary!\>{suffix.Cpp}} ^^{style file!vocabulary!\>{suffix.N}} ^^{style file!vocabulary!\>{suffix.N90}} ^^{style file!vocabulary!\>{suffix.K}} ^^{style file!vocabulary!\>{suffix.R}} ^^{style file!vocabulary!\>{suffix.R90}} ^^{style file!vocabulary!\>{suffix.X}} $$\vbox{\offinterlineskip \halign{\vrule\vrule#&\strut\quad#\quad\hfil&\vrule# &\quad\tt#\quad\hfil&\vrule#% &\hfil\quad\tt#\quad\hfil&\vrule#% &\hfil\quad\tt#\quad\hfil&\vrule\vrule#\cr\tablerule\tablerule &\hfil\It{Language}&&\hfil\It{Style-file entry}&&$\vcenter{\it\hbox{\strut \Unix}\hbox{default\strut}}$ &&$\vcenter{\it\hbox{\strut Non-\Unix}\hbox{default\strut}}$&\cr \tablerule\tablerule &\tt C&&suffix.C&&.c&&.c&\cr\tablerule &\tt \Cpp&&suffix.Cpp&&.c++&&.cpp&\cr\tablerule &\tt FORTRAN--77&&suffix.N&&.f&&.for&\cr\tablerule &\tt FORTRAN--90&&suffix.N90&&.f&&.for&\cr\tablerule &\tt MAKE&&suffix.K&&.mk&&.mk&\cr \tablerule &\tt RATFOR--77&&suffix.R&&.f&&.for&\cr\tablerule &\tt RATFOR--90&&suffix.R90&&.f&&.for&\cr\tablerule &\tt TEX&&suffix.X&&.sty&&.sty&\cr\tablerule\tablerule \summarize{Environment variables}{0.7} Environment variables ^^{environment variables} in \Unix\ and logical names in VMS behave in the same way. FWEB\_INCLUDES &^^{\>{FWEB\UL INCLUDES}} Colon-delimited list (identical in format to the Unix C-shell \.{PATH} variable) of directories to search for include files. ^^{path!for include files} (One can append to this list by means of the \.{-I}~option.) ^^{\={-i}{-I}} ^^{environment variables!\>{FWEB}!\>{FWEB\UL INCLUDES}} \cr FWEB\_INI &^^{\>{FWEB\UL INI}} Name of the initialization file---e.g., \.{fweb.ini}. If not defined, either \.{.fweb} or~\.{fweb.ini} is chosen, depending on the machine. The initialization file always resides in \.{\$HOME}. ^^{\>{.fweb}} ^^{\>{fweb.ini}} ^^{environment variables!\>{FWEB}!\>{FWEB\UL INI}} \cr FWEB\_STYLE\_DIR &^^{\>{FWEB\UL STYLE\UL DIR}} Directory in which style file resides---e.g., \.{\$HOME/fweb}. If not defined, the current directory is used. ^^{environment variables!\>{FWEB}!\>{FWEB\UL STYLE}} \cr HOME &^^{\>{HOME}} Name of the home directory. This variable should be defined by \Unix. ^^{environment variables!Unix!\>{HOME}} \cr TERM &^^{\>{TERM}} The terminal type. Defined by \Unix. ^^{environment variables!Unix!\>{TERM}} \cr \indent To change an environment variable, say, for example (in \Unix) {\codemode setenv FWEB_INCLUDES .:$HOME/fweb:/usr/xxx/stuff setenv FWEB_INI my_FWEB.ini \noindent For VMS, substitute ``\.{define}'' for ``\.{setenv}''. \medskip The built-in function \.{\_GETENV(\It{ENV})} expands to the value of the environment variable~\\{ENV}. ^^{environment variable!obtaining value of} \subsubsection Order of initial operations. \FWEB\ begins its processing by performing the following operations: ^^[processing!order of] {\narrower\newfeature \medskip \feature. Evaluate environment variables. \feature. Read initialization file \.{.fweb}. \feature. Execute \.{.fweb} options beginning with~'\.+'. \feature. Read and execute the command line. \feature. Execute remaining \.{.fweb} options. \feature. Read the style file \.{fweb.sty}. \feature. Process the \WEB\ file. \def\arg#1{{\it[#1]}} \summarize{Command-line syntax}{0.7} ^^{syntax!command-line} ^^{command line!syntax} The command-line syntax is $$\left\{\matrix{\hbox{\FWEAVE}\cr\hbox{\FTANGLE}\cr}\right\} \hbox{ \It{web\_file\_name} [\It{change\_file\_name}] [\It{options}]} where the command-line options, ^^{options, command-line} ^^{command line!options} each of which must begin with a hyphen, are summarized below. (Actually, the options can appear before the file names, or can even be intermixed with them.) If an option has an argument, no space should precede the argument. (E.g., say ``\.{-zmy.sty}'', not ``\.{-z\ my.sty}''.) In the descriptions of the options, the letters~\.T or~\.W in brackets denotes to which processor the command applies; no brackets at all means it applies to both processor. Similarly, parenthesized~\.C, \.N, \.R, or~\.X denotes the applicable language. Italic brackets, as in \.{-d}\It{[nnnnn]}, indicate an optional argument; the brackets themselves shouldn't be typed. Stars mean the command is \It{not} allowed to be optionally changed along with a language change, according to the format `\atcmd{$l$[\It{options}]}' or `\atcmd{L$l$[\It{options}]}'. \summarize{Command-line options {\tt a}--{\tt q}}{0.7} -0 &^^{\>{-0}} Turn off \WEAVE's debugging mode. \[W]. ^^{debugging!turning off}\cr -1 &^^{\>{-1}} Turn on brief debugging mode. (Display irreducible scraps.) \[W]. ^^{debugging!turning on!limited}\cr -2 &^^{\>{-2}} Turn on verbose debugging mode. (Display detailed reductions of the scraps.) \[W]. ^^{debugging!turning on!verbose}\cr -A &^^{\={-a}{-A}} Turn on \&{ASCII} translations. ^^{ASCII!turning on translations to}\cr -b &^^{\>{-b}} Number \&{do} and \&{if}~blocks in woven \Fortran\ and \Ratfor\ output. \[W]. ^^{block numbers}\cr \lstar -c &^^{\>{-c}} Set the global language to~C. ^^{language!global!C}\cr \lstar -c++ &^^{\>{-c++}} Set the global language to~\Cpp. ^^{language!global!\Cpp}\cr -D\It{[letters]}&^^{\={-d}{-D}} Display information about reserved words of the current language (beginning with \It{letters} if present). ^^{reserved words!displaying}\cr -d\It{[nnnnn]} &^^{\>{-d}} Convert unnumbered `\.{do\dots enddo}' constructions to standard \Fortran--77. \[T]; \(N). ^^{\<{do}!numbering}\cr -E$c$ &^^{\={-e}{-E}} Change the delimiter of a file-name extension from the default~'\..' to~$c$. ^^{extensions!file-name!changing delimiter for}\cr -e &^^{\>{-e}} Turn on automatic file-name completion. (See discussion of the style file entries \.{ext.*}.) ^^{file name!automatic completion of}\cr -f &^^{\>{-f}} Turn off module references for identifiers. \[W]. ^^{module!references!turning off}\cr \lstar -h &^^{\>{-h}} Get help from the command line. \It{(Not implemented yet.)} ^^{help!command line}\cr -I\It{directory} &^^{\={-i}{-I}} Append a directory or colon-delimited list of directories to the list of directories to be searched for include files. \cr -i &^^{\>{-i}} Read include files named by the \atcmd{I}~command, but do not print their contents. \[W]. ^^{file!including!not printing}\cr -i! &^^{\>{-i"!}} Don't even read include files named by the \atcmd{I}~command. \[W]. \cr \lstar -L\It{l} &^^{\={-l}{-L{\it l}}} Select global language: $l \in \{\.c,\.n,\.r,\.x\}$. ^^{language!selecting}\cr -l\It{[mmm[:nnn]]} &^^{\>{-l}} Echo the input line constructed by the input driver between lines~\It{mmm} and~\It{nnn}. ^^{debugging!echoing input lines}\cr \lstar -m\It{id[=text]} &^^{\>{-m}} Define a \WEB\ macro. \[T]. \cr -m4 &^^{\>{-m4}} Understand the \.{m4} built-in commands. \[W]. ^^{\>{m4}!understanding commands of}\cr -m; &^^{\>{-m;}} Automatically append a pseudo-semicolon to \WEB\ macro definitions. \[W]. ^^{pseudo-!semicolon!appending automatically}\cr \lstar -n &^^{\>{-n}} Set the global language to \Fortran--77. ^^{language!global!Fortran--77\actual\FORTRAN--77}\cr \lstar -n9 &^^{\>{-n9}} Set the global language to \Fortran--90. ^^{language!global!Fortran--90\actual\FORTRAN--90}\cr -n; &^^{\>{-n;}} For \Fortran--77, supply semicolons automatically. (Default mode.) ^^{semicolons!automatic!Fortran:\FORTRAN}\cr -nb &^^{\>{-nb}} In \Fortran, number the \&{if}s and \&{do}s. \[W]; \(N). ^^{block numbers!\Fortran}\cr -np &^^{\>{-np}} Print semicolons in woven \Fortran\ output. \[W]. ^^{semicolons!printing}\cr -n\BS &^^{\>{-n\BS}} Select free-form \Fortran--90 syntax continued with a backslash. ^^{syntax!free-form!continuing with backslash}\cr -n\amp & ^^{\>{-n\amp}} As above, but continue with an ampersand. ^^{syntax!free-form!continuing with ampersand}\cr -n/ &^^{\>{-n/}} In \Fortran, make '\.{//}'~denote the start of a short comment instead of concatenation. (One can always use~'\.{\\/}' for concatenation.) ^^{comment!short!recognizing in \FORTRAN}\cr -n! &^^{\>{-n"!}} In \Fortran, make `\.!'~denote the start of a short comment instead of the logical \.{NOT}.\cr -o &^^{\>{-o}} Turn off \FWEAVE's mechanisms for overloading operators. \[W]. ^^{operator!overloading!turning off}\cr \lstar -P\It{letter} &^^{\={-p}{-P}} Selects the \TeX\ processor for \FWEAVE's output. Say~`\.{-PL}' for \LaTeX; the default is~`\.{-PT}' for \TeX. \[W]. ^^{\TeX\ processor, selecting} ^^{processor!\TeX} ^^{processor!\LaTeX} \lstar -p\It{styleentry} &^^{\>{-p}} Buffer up a style-file entry, to be processed just before the local style file is read. ^^{style file!global entry}\cr -q &^^{\>{-q}} Do \It{not} translate \Ratfor\ commands into \Fortran. (No longer supported.) \[T]; \(R). \cr \summarize{Command-line options {\tt r}--{\tt z}}{0.7} \lstar -r &^^{\>{-r}} Set the global language to \Ratfor--77. ^^{language!global!Ratfor--77:\RATFOR--77}\cr \lstar -r9 &^^{\>{-r9}} Set the global language to \Ratfor--90. ^^{language!global!Ratfor--90:\RATFOR--90}\cr -rb &^^{\>{-rb}} In \Ratfor, number the \&{if}s and \&{do}s. \[W]; \(N). ^^{block numbers!\Ratfor}\cr -rg\It{params} &^^{\>{-rg}} Set the \&{goto} parameters for \Ratfor's \&{switch}. \[T]; \(R).\cr -rk\It{[letters]} &^^{\>{-rk}} Suppress particular comments about \Ratfor\ statement translation. \[T]; \(R). ^^{Ratfor:\RATFOR!commands!deleting}\cr -rK\It{[letters]} &^^{\={-rk}{-rK}} As above, but write out particular comments. \[T]. \cr -r; &^^{\>{-r;}} Turns on \Ratfor's auto-semi mode, and tells it to use the ``obviously continued'' syntax. \(R). ^^{semicolons!automatic!Ratfor:\RATFOR}\cr -r/ &^^{\>{-r/}} In \Ratfor, make `\.{//}'~denote the start of a short comment instead of concatenation. (One can always use~'\.{\\/}' for concatenation.) \(R). ^^{comment!short!recognizing in \RATFOR}\cr -r!&^^{\>{-r"!}} In \Ratfor, make `\.!'~denote the start of a short comment instead of the logical \.{NOT}. \cr \lstar -s &^^{\>{-s}} Print statistics about memory usage. ^^{statistics}\cr \lstar -sm\It{[nnn]} &^^{\>{-sm}} As above, but also display the dynamic memory allocations of size $\ge$~\It{nnn} as they occur. ^^{memory, dynamic allocation of!statistics for}\cr \lstar -t\It{ln[\{\dots\}]} &^^{\>{-t}} Truncate identifiers of language~$l$ to length~$n$, after optionally filtering out the characters listed between the braces. \[W].\cr \lstar -u\It{id} &^^{\>{-u}} Undefine a predefined or command-line macro. \[T]. ^^{macro!outer!undefining}\cr -v &^^{\>{-v}} Make all comments verbatim. \[T]. ^^{comment!verbatim!making all}\cr -W\It{letters} &Commands that apply only to \FWEAVE. Here \It{letters} may be one or more of the following: \clo{ [&^^{\={-w[}{-W[}} Turn on special processing of bracketed array indices.\cr f&^^{\={-wf}{-Wf}} Don't print format statements (\.{@f}) in woven output.\cr l&^^{\={-wl}{-Wl}} As above, but for limbo statements (\.{@l}).\cr m&^^{\={-wm}{-Wm}} As above, but for macro definitions (\.{@m}).\cr v&^^{\={-wv}{-Wv}} As above, but for operator overloading (\.{@v}).\cr w&^^{\={-ww}{-Ww}} As above, but for identifier overloading (\.{@W}).\cr \noalign{\vskip-5pt} }\cr \lstar -w\It{[file\_name]} &^^{\>{-w}} If \It{file\_name}~is absent, don't print `\.{\\input\ fwebmac.sty}' as the first line of the \.{TEX} output file. Otherwise, print `\.{\\input \It{file}\_\It{name}}'. \[W]. ^^{\>{fwebmac}!\>{.sty}!not printing}\cr \lstar -X\It{[letters]} &^^{\={-x}{-X}} Print selected cross-reference information; the opposite of~`\.{-x}'. ^^{cross-references!suppressing} ^^{index!printing} ^^{module list!suppressing} ^^{table of contents!suppressing}\cr \lstar -x\It{[letters]} &^^{\>{-x}} Reduce or eliminate cross-reference information. The optional letters can be one of~'\.c', '\.i', '\.m', or~'\.*', referring respectively to the table of contents, index, module list, or all cross-reference information. \[W]. ^^{index!not printing}\cr \lstar -y\It{[a[a]][nnnn]} &^^{\>{-y}} Override default for dynamic memory allocation. If \It{nnnn} is omitted, then simply query the default instead of overriding it. The simple command~`\.{-y}' with no argument queries everything. ^^{memory, dynamic allocation of!syntax}\cr -Z\It{[letters]}&^^{\={-z}{-Z}} Display default values of style-file parameters (starting with \It{letters} if present). ^^{style file!parameters!default values of}\cr \lstar -z\It{[name]} &^^{\>{-z}} Override default style-file name. ^^{style file!new name for}\cr \summarize{Command-line options (miscellaneous)}{0.7} -. &^^{\>{-.}} Don't recognize ``dot constants'' in \Fortran\ or \Ratfor. ^^{constant!dot}\cr -\BS &^^{\>{-\BS}} Explicitly escape continued strings. ^^{strings!continuing!with explicit escape}\cr -( &^^{\>{-(}} Continue parenthesized strings with backslashes. ^^{strings!parenthesized!continuing}\cr -:\It{[nnnnn]} &^^{\>{-":}} Set the starting automatic statement number. \[T]. ^^{statement!number!setting}\cr \lstar ->\It{[l=][name]} &^^{\>{->}} Redirect tangled output. ^^{output!redirection}\cr \lstar -= &^^{\>{-=}} Redirect tangled output. Synonymous with~`\.{->}'. Easy to type under \Unix.\cr -\# &^^{\>{-\PM}} Turn off comments about line numbers and module names in tangled output. \[T] ^^{line numbers!turning off}\cr -+ &^^{\>{-+}} Don't interpret the compound assignment operators. \[T]; \(N,R). ^^{operators!compound assignment!not recognizing}\cr -/ &^^{\>{-/}} In both \Fortran\ and \Ratfor, make `\.{//}'~denote the start of a short comment instead of concatenation. (One can always use~'\.{\\/}' for concatenation.)\cr -! &^^{\>{-"!...}} In both \Fortran\ and \Ratfor, make `\.!'~denote the start of a short comment instead of the logical \.{NOT}.\cr \noindent These command-line options may also be put into the ini file \.{.fweb}. ^^{\>{.fweb}} Options beginning with a plus sign are processed \It{before} the command-line options. Otherwise, they are processed after the command-line options. {%\tracingall \summarize{Modules}{0.7} ^^[modules!summary of] \Item Module names are delineated by \.{@<\dots@>}. ^^{section name!beginning!in code} \Item To reference a named module in a macro definition, say `\.{\#<\dots@>}' instead of \atcmd{<\dots@>}. ^^{section name!beginning!in macro} \Item The unnamed module is begun by~\atcmd{A} or~\atcmd{a}. (The latter command inserts an implicit~\atcmd{[}.) \Item \FTANGLE\ outputs the unnamed module. \It{(There must be at least one unnamed section, otherwise there will be no output!)} \TeX\ part & \It{Arbitrary \TeX\ documentation}.\endgraf \medskip \Item Begins with~\atcmd{*} or~\atcmd{\ }. \Item Change to code mode with~\.{|\dots|}.\endgraf definition part & \It{Macro definitions, formatting, limbo text, operator overloading, etc.}\endgraf \medskip \Item Begins with~\atcmd{m}, \atcmd{d}, \atcmd{f}, \atcmd{l}, \atcmd{v}, or~\atcmd{\#...}.\endgraf code part & \It{The source code.}\endgraf \medskip \Item Begins with~\atcmd{a} or~\atcmd{<}. \Item \TeX\ mode inside comments. \Item Ends with~\atcmd{*} or~\atcmd{\ }. (The end of file is like an~\atcmd{\ }.)\endgraf \subsubsection The simplest \WEB\ sources. The absolutely simplest nontrivial \WEB\ source file is ``\.{@\ @a}''. The next simplest is ^^[\>{WEB}!source file!simplest] {\codemode @* EMPTY. \noindent These have a null definition part as well as a null code part. The simplest \Fortran--77 code is {\codemode @* FORTRAN. \Tab program main \Tab end \noindent The same code in \Ratfor\ is {\codemode @* RATFOR. program main \noindent The corresponding code in~C is {\codemode @* C. main() \summarize{Control codes allowed in \WEB\ files}{0.62} ^^[commands!control codes!in \>{WEB} source] \subheading{Literal control characters:} @@ &^^{\>{@@}} Insert the single character~\atcmd{}.\cr @| &^^{\>{@"|}} Insert a vertical bar (\TeX\ text only). In code mode, this command means an optional line break; see the ``Spacing'' commands below. ^^{vertical bar, literal}\cr \subheading{Beginning of module:} @\.\ &^^{\>{@\ }} Begin a new minor (unstarred) module. ^^{module!beginning!unstarred} \cr @*\It{[n]} &^^{\>{@*}} Begin a new major (starred) module of level~$n$. ^^{module!beginning!starred} \cr \subheading{Beginning of code part:} @< &^^{\>{@<...@>}} ^^{\>{@<}} Begin a module name. ^^{module!name!beginning} \cr @> &^^{\>{@>}} End a module name. ^^{module!name!ending} \cr \medalign @A &^^{\={@a}{@A}} Begin the code part of an unnamed module. ^^{module!part!code} \cr @a &^^{\>{@a}} Equivalent to `\atcmd{A@[}'.\cr \subheading{Control codes \.{b}--\.{z}:} @b &^^{\>{@b}} Insert a ^{breakpoint command} in a \WEB\ module.\cr \medalign @c &^^{\>{@c}} Set the language to~C. ^^{language!setting!C}\cr @c++ &^^{\>{@c++}} Set the language to~\Cpp. ^^{language!setting!\Cpp}\cr \medalign @D &^^{\={@d}{@D}} Define an outer macro. ^^{macro!outer!defining}\cr @d &^^{\>{@d}} Equivalent to `\atcmd{D@[}'.\cr \medalign @e &^^{\>{@e}} Invisible (pseudo-) expression.\cr @f &^^{\>{@f}} Format an identifier or module name. ^^{formatting!identifiers} ^^{formatting!module names}\cr \medalign @I &^^{\={@i}{@I}} Include a file, but don't print it out if the \.{-i}~option is used.\cr @i &^^{\>{@i}} Include a file. ^^{file!including}\cr \medalign @L$l$ &^^{\={@l}{@L{\it l}}} Set language to~$l$. ^^{language!setting}\cr @l &^^{\>{@l}} Specify limbo text. ^^{limbo!text}\cr \medalign @M &^^{\={@m}{@M}} Define a \WEB\ macro. ^^{macro!inner!defining}\cr @m &^^{\>{@m}} Equivalent to `\atcmd{M@[}'.\cr \medalign @n &^^{\>{@n}} Set the language to \Fortran--77. ^^{language!setting!Fortran--77:\FORTRAN--77}\cr @n9 &^^{\>{@n9}} Set the language to \Fortran--90. ^^{language!setting!Fortran--90:\FORTRAN--90}\cr \medalign @O &^^{\>{@O}} Open new output file (global scope). ^^{file!output!opening new}\cr @o &^^{\>{@o}} Open new output file (local scope). ^^{file!output!opening new}\cr \medalign @r &^^{\>{@r}} Set the language to \Ratfor--77. ^^{language!setting!Ratfor--77:\RATFOR--77}\cr @r9 &^^{\>{@r9}} Set the language to \Ratfor--90. ^^{language!setting!Ratfor--90:\RATFOR--90}\cr \summarize{Control codes allowed in \WEB\ files, cont'd}{0.62} @u &^^{\>{@u}} Undefine an outer macro. ^^{macro!outer!undefining}\cr \medalign @v &^^{\>{@v}} Overload an operator. ^^{operators!overloading}\cr @W &^^{\>{@W}} Overload an identifier. ^^{identifiers!overloading}\cr \medalign @x &^^{\>{@x}} Terminates ignorable material (begun by~\atcmd{z} at beginning of source or include file). ^^{ignorable material!terminating}\cr @z &^^{\>{@z}} Begins ignorable material at beginning of source or include file. ^^{ignorable material!beginning}\cr \subheading{Conversion to ASCII:} @' &^^{\>{@'}} Convert single character to ASCII. ^^{ASCII!converting to}\cr @" &^^{\>{@""}} Convert string to ASCII. (In \Fortran\ or \Ratfor, generate a call to the function named by the style-file field \.{ASCII\_fcn}.) ^^{ASCII!converting to}\cr \subheading{Markers for forward referencing:} @[ &^^{\>{@[}} Mark the next identifier as defined in this module. ^^{identifiers!marking as defined}\cr @] &^^{\>{@]}} \It{Reserved}; do not use.\cr @` &^^{\>{@`}} \It{Reserved}; do not use.\cr \subheading{Comments:} @/* &^^{\>{@/}} Begin a long verbatim comment. ^^{comment!long!beginning}\cr @// &^^{\>{@/}} Begin a short verbatim comment. ^^{comment!short!beginning}\cr @\% &^^{\>{@\PC}} An ignorable comment: Everything to the next newline is completely ignored. ^^{comment!ignorable}\cr @? &^^{\>{@?}} Begin a compiler directive. ^^{compiler directives!beginning}\cr @! &^^{\>{@"!}} Begin a compiler directive (obsolete). ^^{compiler directives!beginning}\cr @( &^^{\>{@(}} Begin a meta-comment. ^^{comment!meta-!beginning}\cr @) &^^{\>{@)}} End a meta-comment. ^^{comment!meta-!ending}\cr \subheading{Special brace:} @\{ &^^{\>{@\LB}} Suppress default insertion of breakpoint command. ^^{breakpoint command!suppressing insertion of}\cr \subheading{Index entries:} @\UL &^^{\>{@\UL}} Force an index entry to be underlined. ^^{index!entry!underlining} \cr @- &^^{\>{@-}} Delete an index entry for the next identifier. ^^{index!entry!deleting}\cr \medalign @\^ &^^{\>{@\^}} Make an index entry in Roman type. ^^{index!entry!Roman type}\cr @. &^^{\>{@.}} Make an index entry in \.{typewriter} type. ^^{index!entry!typewriter type}\cr @9 &^^{\>{@9}} Make an index entry in a format controlled by `\.{\\9}', which the user must define. ^^{index!entry!user-controlled format}\cr \subheading{Control text:} @t &^^{\>{@t}} Put control text into a \TeX\ \.{\\hbox}. ^^{text!control!putting into hbox}\cr @= &^^{\>{@=}} Pass control text verbatim to the output. ^^{text!control!passing verbatim to output}\cr \summarize{Control codes allowed in \WEB\ files, cont'd}{0.62} \subheading{Spacing:} @, &^^{\>{@,}} Insert a thin space. ^^{insertion!thin space}\cr @/ &^^{\>{@/}} Insert a line break. ^^{insertion!line break}\cr @| &^^{\>{@"|}} Insert an optional line break in an expression. ^^{insertion!optional line break}\cr @\# &^^{\>{@\PM}} Force a line break with some extra white space; very seldom necessary, since blank lines in the source are significant. Also begin a preprocessor command. ^^{insertion!line break!with white space}\cr @+ &^^{\>{@+}} Cancel a line break. ^^{insertion!line break!cancelling}\cr @\amp &^^{\>{@\amp}} Join left and right with no spaces or line breaks inbetween. ^^{joining}\cr \subheading{Pseudo (invisible) operators:} @e & Invisible (pseudo-) expression. ^^{pseudo-!expression}\cr @; &^^{\>{@;}} Invisible (pseudo-) semicolon. ^^{pseudo-!semicolon}\cr @: &^^{\>{@":}} Invisible (pseudo-) colon. ^^{pseudo-!colon}\cr \subsubsection Special format for language changes. The most general form of a language command is {\codemode @\It{[}L\It{]}\It{l}\math\,\math\It{text}[\It{options}] \noindent where $l$~is a language symbol, \It{text} is converted into a hyphenated option, and \It{options} have the same syntax as on the command line. For example, {\codemode @n9[-n&] \noindent means set the language to \Fortran--90 and use free-form syntax with the ampersand as the continuation character. \summarize{Control codes allowed in change files}{0.62} ^^[change file!control codes] ^^[commands!control codes!in change file] The folllowing commands are allowed in change files. They \It{must} begin in column~1. Any line that does not begin with one of these commands is a comment. @x &^^{\>{@x}} Begin a change file entry.\cr @y &^^{\>{@y}} End the old code; begin the replacement code.\cr @z &^^{\>{@z}} End the change file entry.\cr \medalign @c &^^{\>{@c}} Set language to~C.^^{language!changing}\cr @c++ &^^{\>{@c++}} Set language to~\Cpp.^^{language!changing}\cr @n &^^{\>{@n}} Set language to \Fortran--77.\cr @n9 &^^{\>{@n9}} Set language to \Fortran--90.\cr @r &^^{\>{@r}} Set language to \Ratfor--77.\cr @r9 &^^{\>{@r9}} Set language to \Ratfor--90.\cr @L\It{l} &^^{\={@l}{@L{\it l}}} Set language to~$l$.\cr \medalign @[ &^^{\>{@[}} Switch into code mode. (Use for column-oriented language such as \Fortran--77.)^^{code!mode}\cr @] &^^{\>{@]}} Switch out of code mode.\cr \subsubsection The null change file. ^^[change file!null] ^^[file!null] When no change file is specified on the command line, the \WEB\ processors attempt to open and read from the so-called ``null file.'' (This file may or may not actually exist in the directory structure, depending on the system.) The name of this file, which is permanently empty, depends on the operating system and becomes the default value of the style-file option \.{null\_file} according to the following table: $$\vbox{\offinterlineskip \halign{\vrule\vrule#&\strut\quad#\quad\hfil&\vrule#&\hfil\quad\tt#\quad\hfil &\vrule\vrule#\cr\tablerule\tablerule &\It{Operating system}&&\It{Name of null file}&\cr \tablerule\tablerule &IBM/PC&&nul&\cr\tablerule &IBM/MVS&&'NULLFILE'&\cr\tablerule &VAX/VMS&&nl:&\cr\tablerule &\Unix\ or other&&/dev/null&\cr\tablerule\tablerule Usually you must do nothing explicitly to access the null file. However, if \FWEB\ can't find the default null file on your system, just create an empty file whose name is \It{null\_name} and insert into the style file the line ``\.{null\_file "}\It{null\_name}\.{"}''. \summarize{Commenting modes}{0.75} ^^[commenting style] ^^[mode!commenting] ^^{\CS{cmntfont}} ^^{\CS{tenrm}} \FWEB\ allows a variety of commenting styles. The visible comments are in the font \.{\\cmntfont}, which defaults to~\.{\\tenrm}. \subheading{Invisible comments:} @z...@x &^^{\>{@z}} ^^{\>{@x}} If a source or include file begins with~\atcmd{z}, then all material is skipped until and including a line beginning in column~1 with~\atcmd{x}.\cr @\% &^^{\>{@\PC}} All material until and including the next newline is completely ignored.\cr \subheading{Visible comments:} /*...*/ &^^{\>{/*...*/}} A long comment (may extend over several lines). ^^{comment!long}\cr //... &^^{\>{//...}} A short comment (terminated by next newline). ^^{comment!short} (In \Fortran\ or \Ratfor, this must be turned on explicitly with one of the command-line options~`\.{-n/}', `\.{-r/}', or~`\hbox{\.{-/}}'.)\cr !... &^^{\>{"!...}} A short comment in \Fortran\ or \Ratfor. This must be turned on explicitly with one of the command-line options~`\.{-n!}', `\.{-r!}', or~`\.{-!}'.\cr !!... &^^{\>{"!"!...}} A short comment in \Fortran\ or \Ratfor.\cr @(...@) &^^{\>{@(}} A meta-comment. The material between~\atcmd{(} and~\atcmd{)} is typeset in a verbatim environment, and is appropriately passed to the tangled output. (See the style-file parameters \.{meta.*}.) ^^{comment!meta-}\cr \subsubsection Alternatives for `dot' commands in \Fortran\ and \Ratfor. ^^{input!alternative operators for} Although \Fortran\ and \Ratfor\ allow standard `dot' commands such as~`\.{.LT.}', they are considered to be obsolete; more modern alternatives are preferred. \input dots \subsubsection Considerations about formatting. ^^{formatting} The construction {\codemode @f \It{identifier} \It{old\_identifier} \medskip \noindent makes \It{identifier} behave like \It{old\_identifier}. The \It{old\_identifier} may be one of the following special names, which insert extra spaces according to the positions of the underscores and behave as the part of speech indicated by the base names. These are useful for dealing with macro constructions. {\codemode $_BINOP_ $_COMMA_ $_EXPR $_EXPR_ $EXPR_ $UNOP_ When the current language is \.{TEX}, the format command can be used to change a category code according to the format {\codemode @f `\It{\TeX char} \It{new\_cat\_code} \summarize{Macro commands}{0.7} ^^[macros!command summary] Outer macros, defined by~\.{@d}, ^^{\>{@d}} are copied to the beginning of the output file. Inner \WEB\ macros are defined by~\.{@m}. ^^{\>{@m}} \WEB\ macro definitions in the definition section are collected at the beginning of the unnamed module. \WEB\ macro definitions in the code section (deferred definitions) become known when they are encountered while the code is being output. \medskip \WEB\ macro definitions have one of the following three forms: $$\def\args{{\tt(}args{\tt)} } \tt\eqalignno{ \llap{@m } &\hbox{\it name\args text}\cr \llap{@m* } &\hbox{\it name\args text}\cr \llap{@m[bfimps*] } &\hbox{\it name\args text}\cr In the second form, the asterisk means that the macro may be recursive, ^^{macro!recursive} although \It{this feature is not implemented yet}. In the third form, which is useful only for \Ratfor, ^^{\>{\Ratfor}} the brackets means that the contents of this macro are to be inserted automatically at the beginning of the type of program unit identified by the characters within the brackets. ^^{automatic insertion} ^^{insertion!automatic} See the text for more information. \medskip Macros with a variable number of arguments are indicated by an ellipsis ^^{ellipsis "(\noexpand\dots")}, as in `\atcmd{m\ VAR(x,y,z,...)\ \It{text}}'. \medskip Adjacent strings in macro text are automatically concatenated. ^^{strings!concatenating} \medskip The following special tokens can be used in the text of \WEB\ definitions. Here \It{parameter} means a dummy argument in the argument list of a function-like macro. \subheading{ANSI C-compatible tokens:} \#\# &^^{\>{\PM\PM}} Paste together tokens to left and right. (ANSI~C-compatible.) ^^{token pasting} \cr \#\It{parameter} & Convert parameter to string, without expansion. (ANSI~C-compatible.) ^^{stringizing} \subheading{Extensions to ANSI~C macro syntax:} ^^{extensions!to ANSI C macro syntax} \#*\It{parameter} &^^{\>{\PM*}} As above, but pass a quoted string through unchanged.\cr \#!\It{parameter} &^^{\>{\PM"!}} Don't expand argument.\cr \#'\It{parameter} &^^{\>{\PM'}} Convert parameter to a single-quoted string, without expansion.\cr \#"\It{parameter} &^^{\>{\PM""}} Convert parameter to a double-quoted string, without expansion.\cr \#0 & ^^{\>{\PM0}} The number of variable arguments. ^^{macro!arguments!number of} \#\It{n} & ^^{\>{\PM}$n$} The $n^{\rm th}$ variable argument, counting from~1.\cr \#\{0\} & ^^{\>{\PM\LB0\RB}} Like~\.{\#0}, but the argument may be a macro or expression known at output time.\cr \#\{\It{n}\} & ^^{\>{\PM\LB$n$\RB}} Like~\.{\#$n$}, but the argument may be an expression.\cr \#[0] & ^^{\>{\PM[0]}} The total number of arguments (fixed plus variable). (The argument may be an expression.)\cr \#[\It{n}] & ^^{\>{\PM[$n$]}} The $n^{\rm th}$ argument (including the fixed ones), counting from~1. (The argument may be an expression.)\cr \#. & ^^{\>{\PM.}} A comma-separated list of all variable arguments.\cr \#:0 &^^{\>{\PM":}} Unique statement number (expanded during phase~1).\cr \#:\It{nnn} & Unique statement number for each invocation of this macro (expanded during phase~2). ^^{statement!number} \#< &^^{\>{\PM<...@>}} Begin a section name. (Ends with~\atcmd{>}.) ^^{section name!beginning!in macro} \#, &^^{\>{\PM,}} An ``internal'' comma; does not delimit the end of an argument. ^^{commas!as delimiters of macro arguments} ^^{commas!as part of a macro argument} {%\tracingall \summarize{Preprocessor commands}{0.7} ^^[commands!preprocessor!summary] ^^[preprocessing] \WEB\ preprocessor commands may appear in either the definition or the code part. But \It{beware}: No matter where they appear, they are expanded during \It{input}, not output. @\#define \Identifier\ &^^{\>{@\PM define}} Define a \WEB\ macro; equivalent to \atcmd{m}. ^^{\>{@m}} \cr @\#undef \Identifier\ &^^{\>{@\PM undef}} Undefine a \WEB\ macro.\cr \medalign @\#ifdef \Identifier\ &^^{\>{@\PM ifdef}} Is \WEB\ macro defined? Equivalent to `\.{\If{} defined \Identifier}'.\cr @\#ifndef \Identifier\ &^^{\>{@\PM ifndef}} Is \WEB\ macro not defined? Equivalent to `\.{\If{} !defined \Identifier}'.\cr \medalign @\#if \expr^^{\>{@\PM if}}\cr @\#elif \expr^^{\>{@\PM elif}}\cr @\#else^^{\>{@\PM else}}\cr @\#endif^^{\>{@\PM endif}}\cr \summarize{Built-in \FWEB\ macros (A--K)}{0.55} ^^[macros!built-in!summary of] Built-in macros are expanded during output while processing the code part. They all begin with an underscore and are in upper case. \It{User-defined macros should not begin with an underscore or a dollar sign.} In the following argument lists, \It{string} means a character string that should be surrounded by quotes. In a few cases the quotes are optional if the argument is a single alphanumeric identifier, but don't use this property unless you really have to. \_A(\It{string}) &^^{\>{\UL A}} The built-in equivalent to~\.{@'\dots'} or~\.{@"\dots"}. (Note the extra parentheses required by the built-in.) ^^{\>{@'}} ^^{\>{@""}}\cr \_ABS(\expr) &^^{\>{\UL ABS}} Absolute value of \expr.\cr \_ASSERT(\expr) &^^{\>{\UL ASSERT}} Evaluates \expr; if false, prints an error message and aborts.\cr \_COMMENT(\It{string}) &^^{\>{\UL COMMENT}} Generate a comment in the output file.\cr \_DATE &^^{\>{\UL DATE}} A string consisting of the date in the form \.{"August\ 15,\ 1989"}.\cr \_DAY &^^{\>{\UL DAY}} A string consisting of the day of the week in the form \.{"Monday"}.\cr \_DECR(N) &^^{\>{\UL DECR}} Decrement a macro.\cr \_DEFINE(defn) &^^{\>{\UL DEFINE}} Deferred macro definition.\cr \_DO(\It{macro},\It{imin},\It{imax}\It{[,$\Delta i$]}\{\dots\} &^^{\>{\UL DO}} Repetitively defines \It{macro} as would the \Fortran\ \&{do}~loop \.{do \It{macro} = \It{imin},\It{imax},$\Delta i$}.\cr \_DUMPDEF($m_1$,$m_2$,\dots) &^^{\>{\UL DUMPDEF}} Here $m_1$, $m_2$, etc.\ are macro calls (with argument list if appropriate). The macro definitions and their expansions are dumped to the terminal.\cr \_ERROR(\It{string}) &^^{\>{\UL ERROR}} Send \.{string} to the standard error message facility.\cr \_EVAL(\expr) &^^{\>{\UL EVAL}} Evaluate a macro expression.\cr \_GETENV(\It{name}) &^^{\>{\UL GETENV}} Returns the present value of the environment variable \It{name}.^^{variable!environment}\cr \_HOME &^^{\>{\UL HOME}} The user's home directory; equivalent to \.{\_GETENV(HOME)}.\cr \_IF(\expr,$t$,$f$) &^^{\>{\UL IF}} Evaluates \expr. If true, returns~$t$; otherwise, returns~$f$.\cr \_IFCASE(\It{expr},\It{case\_0},\dots,\It{case\_n},\It{dflt}) &^^{\>{\UL IFCASE}} Evaluates \It{expr} to an integer~$m$. If $0 \le m \le n$, then \It{case\_m} is selected. Otherwise, the \It{dflt} is selected.\cr \_IFDEF(\It{macro},$t$,$f$) &^^{\>{\UL IFDEF}} If \It{macro} is defined, returns~$t$; otherwise, returns~$f$.\cr \_IFNDEF(\It{macro},$t$,$f$) &^^{\>{\UL IFNDEF}} As above, but returns~$t$ if not defined.\cr \_IFELSE(s1,s2,$t$,$f$) &^^{\>{\UL IFELSE}} Compares \.{s1} to \.{s2}. If identical, returns~$t$; otherwise, returns~$f$.\cr \_INCR(N) &^^{\>{\UL INCR}} Increment a macro.\cr \_INPUT\_LINE &^^{\>{\UL INPUT\UL LINE}} Line number (in \WEB\ source file) that begins current section.\cr \summarize{Built-in \FWEB\ macros (L--Z)}{0.55} \_L(\It{string}) &^^{\>{\UL L}} Changes \It{string} to lower case.\cr \_LANGUAGE &^^{\>{\UL LANGUAGE}} An identifier such as~`\.{\_C}' ^^{\>{\UL C}} ^^{\>{\UL CPP}} ^^{\>{\UL N}} ^^{\>{\UL N90}} ^^{\>{\UL R}} ^^{\>{\UL R90}} ^^{\>{\UL X}} depending on the current language. (See the table below under \.{\_LANGUAGE\_NUM}.) Intended to be used with an \.{\_IFELSE}.\cr \_LANGUAGE\_NUM &^^{\>{\UL LANGUAGE\UL NUM}} An integer according to the following table; intended to be used with an \.{\_IFCASE}. \endgraf \LANBUILTINS\cr \_LEN(string) &^^{\>{\UL LEN}} Length of (unexpanded) argument interpreted as a character string.\cr \_M(defn) &^^{\>{\UL M}} Equivalent to \.{\_DEFINE}.\cr \_MAX($a$,$b$) &^^{\>{\UL MAX}} Maximum of the two expressions~$a$ and~$b$.\cr \_MIN($a$,$b$) &^^{\>{\UL MIN}} Minimum of~$a$ and~$b$.\cr \_MODULE\_NAME &^^{\>{\UL MODULE\UL NAME}} Name of present \WEB\ module.\cr \_MODULES &^^{\>{\UL MODULES}} The total number of \It{independent} modules: namely, the total number of independent module names, plus~1 for the unnamed module.\cr \_OUTPUT\_LINE &^^{\>{\UL OUTPUT\UL LINE}} Current line number of tangled output.\cr \_P &^^{\>{\UL P}} The C~preprocessor symbol~'\.{\#}'; a synonym for ``\.{\_UNQUOTE("\#")}''.\cr \_POW($x$,$y$) &^^{\>{\UL POW}} Exponentiation: $x^y$.\cr \_ROUTINE &^^{\>{\UL ROUTINE}} In \Ratfor\ mode, expands to a string built of the name of the current program, function, or subroutine; not useful for other languages, for which it expands to the empty string.\cr \_SECTION\_NUM &^^{\>{\UL SECTION\UL NUM}} Number of current \WEB\ section.\cr \_SECTIONS &^^{\>{\UL SECTIONS}} The maximum section number as understood by \WEAVE.\cr \_STRING(s) &^^{\>{\UL STRING}} Expands its argument, then stringizes it according to~\.{\#*}.\cr \_STUB(name) &^^{\>{\UL STUB}} References to undefined modules ^^{modules!undefined} are automatically replaced by a call to this macro, with the module name as argument.\cr %\_SWITCH() &^^{\>{\UL SWITCH}} \It{Not implemented yet}.\cr \_TIME &^^{\>{\UL TIME}} A string consisting of the local time in the form \.{"19:59"}.\cr \_TRANSLIT(\It{string},\It{from},\It{to}) &^^{\>{\UL TRANSLIT}} Interprets all arguments as character strings; replaces the \\{from} characters in~\\{s} by the corresponding \\{to}~characters.\cr \_U(\It{string}) &^^{\>{\UL U}} Changes \It{string} to upper case.\cr \_UNDEF(\It{macro}) &^^{\>{\UL UNDEF}} Undefine a macro.\cr \_UNQUOTE(\It{string}) &^^{\>{\UL UNQUOTE}} Returns \It{string}, without the surrounding quotes. \cr \_VERBATIM(\It{string}) &^^{\>{\UL VERBATIM}} Obsolete name for \.{\_UNQUOTE}.\cr \_VERSION &^^{\>{\UL VERSION}} A string built out of the \.{FWEB} version number---e.g., \hbox{\.{"\FWEBversion"}}.\cr \summarize{Ratfor\ commands}{0.5} ^^[Ratfor:\RATFOR!commands!summary of] Select \Ratfor--77 with~\atcmd{r} or~\atcmd{r7}; select \Ratfor--90 with~\atcmd{r9}. Disable \Ratfor\ statement translation with command-line option~`\.{-q}' (obsolete). In all cases, the construction~$\stmt$ can be replaced by a simple statement terminated by a semicolon. ^^{\>{-q}} \endgraf \subheading{Ratfor--77 commands:} break; &^^{\<{break}} Exit loop or \&{switch} immediately.\cr case $i$: &^^{\<{case}} Used only inside \&{switch}.\cr default:&^^{\<{default}} Used only inside \&{switch}.\cr do \dots; \stmt &^^{\<{do}} \Fortran's \&{do} statement. (The semicolon is required only when the \&{do} is followed by a simple statement; it is optional when followed by a left brace.)\cr else \stmt &^^{\<{else}} Used in conjunction with \&{if}.\cr for($a$;$b$;$c$) \stmt\ &^^{\<{for}} Execute~$a$. Test~$b$. If true, execute body. Execute~$c$. Test~$b$ again and iterate.\cr if(\cond) \stmt\ &^^{\<{if}} \Fortran's \&{if}\dots\&{then}.\cr next; &^^{\<{next}} Go to bottom of loop.\cr repeat \stmt\ until(\cond); &^^{\<{repeat}} Execute body. If \cond\ is true, iterate.\cr return \expr; &^^{\<{return}} Return value from function.\cr switch(\expr) \stmt &^^{\<{switch}} Select various cases. (Cases fall through unless terminated by \&{break}.)\cr while(\cond) \stmt\ &^^{\<{while}} If \cond\ is true, execute body of loop.\cr \subheading{Additional Ratfor--90 commands:} contains: &^^{\<{contains}} Note the colon.\cr interface \It{name} \stmt\ &^^{\<{interface}} Used as in \Fortran--90, but note the braces.\cr interface operator(\It{operator}) \stmt\ &As in \Fortran--90.\cr interface assignment(\It{assignment}) \stmt\ &As in \Fortran--90.\cr module \It{name} \stmt\ &^^{\<{module}} As in \Fortran--90.\cr private: &^^{\<{private}} Note the colon.\cr sequence: &^^{\<{sequence}} Note the colon.\cr type \It{name} \stmt; &^^{\<{type}} Note the semicolon.\cr where(\expr) \stmt\ &^^{\<{where}} \Fortran--90 array operations; may be followed by an optional \&{else} clause.\cr Caviats and nuances about \FWEB\ \Ratfor: ^^[\Ratfor!caviats] \newfeature \feature: Numeric statement labels must be followed by a colon; they should be first on their line. \feature: The quoting convention for characters and strings follows that of~C: Single-quote single characters, double-quote strings. \feature: In a \&{switch}, cases fall through to the next case unless terminated by \&{break} (just as in~C). \feature: The \&{do} statement must be terminated by a semicolon if followed by a simple statement. (It's unnecessary if followed by a left brace that begins a compound statement.) \feature: Use \.{\&\&} and~\.{||} for the logical AND and OR. \feature: Do not use an \&{end} statement at the very end of a program unit; it is added automatically when the closing brace is sensed. \def\TEXTs{sample\BS\_id}\def\TEXT{sample\_id} \summarize{Code mode and the principal {\tt fwebmac} typesetting macros}{0.5} ^^[macros!typesetting] The construction \.{\vertbar\dots\vertbar} signifies code mode; ^^{code!mode} it may be used in \TeX\ text (including comments and module names) to typeset code or identifiers between the bars. When code mode is used, entries are made in the index. Alternatively, the following macros may be used; these do not make entries in the index: \BS Wtypewriter\{\TEXTs\} &^^{\CS{Wtypewriter}} Typeset in typewriter type, such as ``\.{\TEXT}''.\cr \BS Wshort\{x\} &^^{\CS{Wshort}} Use for single-character identifiers, such as~``\|x''. (Do not use \WEB's shorthand notation~``\.{\\|x}'' ^^{\CS{"|}} for this purpose, as the bar gets confused with the entry into code mode.)\cr \BS Wid\{\TEXTs\} &^^{\CS{Wid}} Ordinary identifiers, such as ``\\{\TEXT}''.\cr \BS Wreserved\{\TEXTs\} &^^{\CS{Wreserved}} For reserved words, such as ``\&{\TEXT}''.\cr \BS Wintrinsic\{\TEXTs\} &^^{\CS{Wintrinsic}} For intrinsic functions, such as ``\IF{\TEXT}''.\cr \noindent In the arguments of the above macros, you must precede the special characters ``\.{\ \\\#\%\$\^\{\}\~\&\_}'' by a backslash. \medskip For brevity, the above macros are equivalenced to shorter macros, as follows: \input equiv \def\acd(#1){(\.{0x#1})} \summarize{Escape sequences}{0.5} ^^[escape sequences] \FWEB\ follows ANSI~C in recognizing the following escape sequences within strings. (The corresponding \&{ASCII} code is in parentheses.) \BS' \acd(27) & \It{Literal apostrophe}.\cr \BS" \acd(22) & \It{Literal quotation mark}.\cr \BS?$\vphantom{a}$ \acd(3F) & \It{Literal question mark}.\cr \BS\BS\ \acd(5C) & \It{Literal backslash}.\cr \BS a \acd(07) & \It{Alert}---ring the bell or print visual alert.\cr \BS b \acd(08) & \It{Horizontal backspace}.\cr \BS f \acd(0C) & \It{Form feed}---force output device to begin a new page.\cr \BS n \acd(0A) & \It{Newline}---move to next line.\cr \BS r \acd(0D) & \It{Carriage return}---move to beginning of line.\cr \BS t \acd(09) & \It{Horizontal tab}---move to next tab mark.\cr \BS v \acd(0B) & \It{Vertical tab}---move to next tab mark.\cr \BS \It{NNN} & \It{Octal number}.\cr \BS x\It{NN} & \It{Hexadecimal number}.\cr \summarize{Conventions for \FWEAVE's identifiers}{0.7} Following are the interpretation of the various fonts used in the output produced by \FWEAVE. Subscripts mean the number of the section in which the identifier was defined. In the index, underlined section numbers mean the identifier was defined there. \subheading{Automatically-generated entries:} {\it italics} & An ordinary identifier such as~\|x or~\\{xyz}.\cr {\it mark\/}$\WIN0{90}$ & An identifier explicitly marked with~\.{@[}.\cr {\it name\/}$\WIN1{91}$ & A function name such as \\{main} defined in section~98.\cr {\it inner\/}$\WIN2{92}$ & A \WEB\ macro.\cr {\it outer\/}$\WIN3{93}$ & An outer macro.\cr {\bf boldface} & A reserved word such as \&{integer}.\cr {\bf newtype}$\WIN5{95}$ & A new type created via \&{typedef}.\cr {\bfit boldfaced italic} & An intrinsic function such as \IF{sin}.\cr {\tt TYPEWRITER} & A \Fortran\ keyword such as \.{BLOCKSIZE}. (These must be in upper case.)\cr \subheading{User-defined entries:} {\tt typewriter} &\.{@.\dots@>}\cr {\rm Roman} &\.{@\^\dots@>}\cr {\ss user-defined} &\.{@9\dots@>}. For example, to make an index entry in {\ss sans serif} type say ``\.{\\def\\9\#1\{\{\\tenss\#\}\}}''.\cr \summarize{Special array processing}{0.7} In \Fortran\ and \Ratfor, \FTANGLE\ replaces left and right square brackets (outside of strings) by left and right parentheses. Thus, brackets can be used for array subscripts if one desires. \medskip When the option `\.{-W[}' is used, \FWEAVE\ replaces square brackets by a special \TeX\ macro. To change the appearance of array indices, redefine the macro \.{\\WARRAY}. ^^{\CS{WARRAY}} For example, to subscript indices, say ``\.{\\let \\WARRAY\\WSUB}''. \par\par ^^{\CS{WSUB}} ^^)syntax!summary) \appendix M: CUSTOMIZING via the STYLE FILE.[][20.13.11] The default name of the style file is \.{fweb.sty}; ^^{\>{fweb.sty}} change that with the `\.{-z}'~command-line option. ^^{\>{-z}} \TeX-like comments (beginning with~'\.{\%}') may be included. An alphabetized list of the vocabulary commands may be found in the index under ``\.{style file, vocabulary}''. The command syntax is {\codemode \It{keyword [=] value} \medskip \noindent For example, {\codemode LaTeX.options = "eqalign" \medskip The style-file parameters are user-specific. The local style file is intended to be used for changes that are run-specific. (Contrast that with the initialization file \.{.fweb}, ^^{\>{.fweb}} which is intended to set the user's default environment for all runs.) Style-file parameters that are intended to permanently override \FWEB's defaults should be put into \.{.fweb} by using the `\.{+p}'~option. ^^{\>{-p}} A mechanism is also provided to aid in installation-wide customization ^^{customization!installation-wide} done when \FWEB\ is compiled. This is explained in the separate documentation about installation and in the source file \.{custom.web}. ^^{\>{custom.web}} \def\stylehook#1{\subsubsection #1.\par \let\subtitle\empty \kern-\baselineskip} \input index.stl \input modules.stl \input contents.stl \input subs.stl \input formats.stl \input wmisc.stl \input t.stl \input wtmisc.stl \input auto.stl \input colors.stl \input ccodes.stl \appendix N: MEMORY ALLOCATION.[] ^^(memory, dynamic allocation of!summary( The command-line option~`\.{-y}' ^^{\>{-y}} ^^{statistics} is used to change the default allocation for a dynamic memory array, as in~`\.{-ym4000}'. To query the present allocations of variable~\It{aa}, where \It{aa}~is the abbreviation in the list below, just say ``\.{-y\It{aa}}'' with no numeric argument. To query everything, say ``\.{-y}''. The option~`\.{-s}' ^^{\>{-s}} reports memory-usage statistics at the end of the run. The option~`\.{-sm\It{[n]}}' ^^{\>{-sm}} reports allocations of~$n$ or more bytes as they occur. If $n$~is omitted, $n = 10000$ is assumed. \medskip Here is a brief discussion \It{(not completed yet!)} of the dynamic arrays and their abbreviations. (For more information, please study the code.) $$\def\var#1 (#2){\\{#1}~(\.{"#2"})} \vbox{\halign{\var #\hfil&\ ---\ \vtop{\hsize=0.65\hsize\noindent\hang\strut#\strut}\hfil\cr buf\_size (bs)&Size of the change buffer.\cr C\_buf\_size (cb)&Buffer size for single-character buffered output in~C.\cr cmd\_fmt\_size (cf)&Buffer size for certain output messages in \Ratfor.\cr cmd\_msg\_size (cg)&As above.\cr delta\_dots (d)&Number of additional entries to reallocate for the \\{dots} array if necessary.\cr line\_length (ll)&Line length for \FWEAVE's output. \cr longest\_name (ln)&Module names or strings shouldn't be longer than this.\cr max\_bytes (b)&Maximum number of bytes in identifiers, index entries, and module names.\cr max\_dtexts (dx)&Maximum number of deferred replacement texts.\cr max\_dtoks (dt)&Maximum number of tokens in \FTANGLE's deferred macro pool.\cr max\_expr\_chars (lx)&Maximum length of expressions for compound assignments.\cr max\_lbls (lb)&Maximum nesting level in \Ratfor.\cr max\_modules (m)&Must be larger than the maximum number of modules.\cr max\_names (n)&Maximum number of identifiers, strings, and module names.\cr max\_refs (r)&Maximum number of cross-references.\cr max\_scraps (s)&Maximum number of scraps during \FWEAVE's parsing.\cr max\_texts (x)&Maximum number of replacement texts for \FTANGLE.\cr max\_toks (tt)&Maximum number of tokens in \FTANGLE's compressed code.\cr max\_toks (tw)&Maximum number of tokens in current code text being parsed by \FWEAVE.\cr mbuf\_size (mb)&Size of the area into which macros are expanded. This must be large enough to hold all intermediate levels of expansion as well as the final result. Furthermore, in some complicated situations, especially in \Ratfor, more than one macro buffer can be open at once.\cr num\_files (nf)&Number of open files, especially for the \.{@o}~command.\cr op\_entries (op)&Size of the table that handles overloaded operators. A fixed table of length~128 is always used to handle operators such as~`\.{=}'. The quantity \\{op\_entries} must be greater than that amount by the number of new names that are explicitly overloaded.\cr sbuf\_len (sb)&Length of input line buffer for style file.\cr stack\_size (kt)&\FTANGLE's stack size.\cr stack\_size (kw)&\FWEAVE's stack size.\cr X\_buf\_size (xb)&Size of \TeX's output buffer.\cr Thus, for example, to set the maximum number of modules to be 4000, say ``\.{-ym4000}''. ^^)memory, dynamic allocation of!summary) \appendix O: CHARACTER SETS.[][19.15.2] \FWEB\ works internally with the ASCII character set. Users of some IBM machines may need to be familiar with the EBCDIC character set as well. \subsubsection The ASCII character set. ^^(character!set!ASCII( Here is the ASCII character set, shown in octal, decimal, and hexadecimal. The escape sequences recognized by~C and~\FWEB\ are also shown where appropriate. [This table is a minor modification of that given in the excellent book by the Mark Williams Company, {\sl ANSI~C: A Lexical Guide} (Prentice Hall, Englewood Cliffs, New Jersey, 1988), p.~66.] \rm\def\ANSI#1\par{\smallbreak $$\def\ctrl##1{$\langle${\bf ctrl--{\tt##1}}$\rangle$\ } \vbox{\halign{\hfil0##\unskip\qquad&\hfil##\unskip\qquad &\hfil0x\tt##\unskip\qquad&\hfil\tt##\unskip\qquad &\vtop{\hsize=0.5\hsize \noindent\hang\strut##\strut}\hfil\cr#1}}$$\vfill\eject} \ANSI 00 & 0 & 00 & NUL & \ctrl{@} Null character\cr 01 & 1 & 01 & SOH & \ctrl{A} Start of header\cr 02 & 2 & 02 & STX & \ctrl{B} Start of text\cr 03 & 3 & 03 & ETX & \ctrl{C} End of text\cr 04 & 4 & 04 & EOT & \ctrl{D} End of transmission\cr 05 & 5 & 05 & ENQ & \ctrl{E} Enquiry\cr 06 & 6 & 06 & ACK & \ctrl{F} Positive acknowledgement\cr 07 & 7 & 07 & BEL & \ctrl{G} Alert (``bell'') (\.{'\\a'})\cr 10 & 8 & 08 & BS & \ctrl{H} Backspace (\.{'\\b'})\cr 11 & 9 & 09 & HT & \ctrl{I} Horizontal tab (\.{'\\t'})\cr 12 & 10 & 0A & LF & \ctrl{J} Line feed (``newline'') (\.{'\\n'})\cr 13 & 11 & 0B & VT & \ctrl{K} Vertical tab (\.{'\\v'})\cr 14 & 12 & 0C & FF & \ctrl{L} Form feed (\.{'\\f'})\cr 15 & 13 & 0D & CR & \ctrl{M} Carriage return (\.{'\\r'})\cr 16 & 14 & 0E & SO & \ctrl{N} Shift out\cr 17 & 15 & 0F & SI & \ctrl{O} Shift in\cr 20 & 16 & 10 & DLE & \ctrl{P} Data link escape\cr 21 & 17 & 11 & DC1 & \ctrl{Q} Device control 1 (XON)\cr 22 & 18 & 12 & DC2 & \ctrl{R} Device control 2 (tape on)\cr 23 & 19 & 13 & DC3 & \ctrl{S} Device control 3 (XOFF)\cr 24 & 20 & 14 & DC4 & \ctrl{T} Device control 4 (tape off)\cr 25 & 21 & 15 & NAK & \ctrl{U} Negative acknowledgement\cr 26 & 22 & 16 & SYN & \ctrl{V} Synchronize\cr 27 & 23 & 17 & ETB & \ctrl{W} End of transmission block\cr 30 & 24 & 18 & CAN & \ctrl{X} Cancel\cr 31 & 25 & 19 & EM & \ctrl{Y} End of medium\cr 32 & 26 & 1A & SUB & \ctrl{Z} Substitute\cr 33 & 27 & 1B & ESC & \ctrl{[} Escape\cr 34 & 28 & 1C & FS & \ctrl{\BS} Form separator\cr 35 & 29 & 1D & GS & \ctrl{]} Group separator\cr 36 & 30 & 1E & RS & \ctrl{\^} Record separator\cr 37 & 31 & 1F & US & \ctrl{\_} Unit separator\cr \ANSI 40 & 32 & 20 & \.{\ } & Space\cr 41 & 33 & 21 & {!} & Exclamation point\cr 42 & 34 & 22 & " & Quotation mark (\.{'\\"'})\cr 43 & 35 & 23 & \# & Pound (sharp) sign\cr 44 & 36 & 24 & \$ & Dollar sign\cr 45 & 37 & 25 & \% & Percent sign\cr 46 & 38 & 26 & \amp & Ampersand\cr 47 & 39 & 27 & ' & Apostrophe (right quote) (\.{'\\''})\cr 50 & 40 & 28 & ( & Left parenthesis\cr 51 & 41 & 29 & ) & Right parenthesis\cr 52 & 42 & 2A & * & Asterisk\cr 53 & 43 & 2B & + & Plus sign\cr 54 & 44 & 2C & , & Comma\cr 55 & 45 & 2D & - & Hyphen (minus sign)\cr 56 & 46 & 2E & {.} & Period\cr 57 & 47 & 2F & / & Virgule (slash)\cr 60 & 48 & 30 & 0\cr 61 & 49 & 31 & 1\cr 62 & 50 & 32 & 2\cr 63 & 51 & 33 & 3\cr 64 & 52 & 34 & 4\cr 65 & 53 & 35 & 5\cr 66 & 54 & 36 & 6\cr 67 & 55 & 37 & 7\cr 70 & 56 & 38 & 8\cr 71 & 57 & 39 & 9\cr 72 & 58 & 3A & {:} & Colon\cr 73 & 59 & 3B & ; & Semicolon\cr 74 & 60 & 3C & $<$ & Less-than (left angle bracket)\cr 75 & 61 & 3D & $=$ & Equal sign\cr 76 & 62 & 3E & $>$ & Greater-than (right angle bracket)\cr 77 & 63 & 3F & {?} & Question mark (\.{'\\?'})\cr \ANSI 100 & 64 & 40 & {@} & At sign\cr 101 & 65 & 41 & A\cr 102 & 66 & 42 & B\cr 103 & 67 & 43 & C\cr 104 & 68 & 44 & D\cr 105 & 69 & 45 & E\cr 106 & 70 & 46 & F\cr 107 & 71 & 47 & G\cr 110 & 72 & 48 & H\cr 111 & 73 & 49 & I\cr 112 & 74 & 4A & J\cr 113 & 75 & 4B & K\cr 114 & 76 & 4C & L\cr 115 & 77 & 4D & M\cr 116 & 78 & 4E & N\cr 117 & 79 & 4F & O\cr 120 & 80 & 50 & P\cr 121 & 81 & 51 & Q\cr 122 & 82 & 52 & R\cr 123 & 83 & 53 & S\cr 124 & 84 & 54 & T\cr 125 & 85 & 55 & U\cr 126 & 86 & 56 & V\cr 127 & 87 & 57 & W\cr 130 & 88 & 58 & X\cr 131 & 89 & 59 & Y\cr 132 & 90 & 5A & Z\cr 133 & 91 & 5B & {[} & Left bracket\cr 134 & 92 & 5C & \ttBS & Backslash (\.{'\\\\'})\cr 135 & 93 & 5D & {]} & Right bracket\cr 136 & 94 & 5E & {\^} & Circumflex\cr 137 & 95 & 5F & \_ & Underscore\cr \ANSI 140 & 96 & 60 & \.{\`} & Grave (left quote)\cr 141 & 97 & 61 & a\cr 142 & 98 & 62 & b\cr 143 & 99 & 63 & c\cr 144 & 100 & 64 & d\cr 145 & 101 & 65 & e\cr 146 & 102 & 66 & f\cr 147 & 103 & 67 & g\cr 150 & 104 & 68 & h\cr 151 & 105 & 69 & i\cr 152 & 106 & 6A & j\cr 153 & 107 & 6B & k\cr 154 & 108 & 6C & l\cr 155 & 109 & 6D & m\cr 156 & 110 & 6E & n\cr 157 & 111 & 6F & o\cr 160 & 112 & 70 & p\cr 161 & 113 & 71 & q\cr 162 & 114 & 72 & r\cr 163 & 115 & 73 & s\cr 164 & 116 & 74 & t\cr 165 & 117 & 75 & u\cr 166 & 118 & 76 & v\cr 167 & 119 & 77 & w\cr 170 & 120 & 78 & x\cr 171 & 121 & 79 & y\cr 172 & 122 & 7A & z\cr 173 & 123 & 7B & \{ & Left brace\cr 174 & 124 & 7C & | & Vertical bar\cr 175 & 125 & 7D & \} & Right brace\cr 176 & 126 & 7E & $\sim$ & Tilde\cr 177 & 127 & 7F & DEL & Delete\cr ^^)character!set!ASCII) \subsubsection The EBCDIC character set. ^^(character!set!EBCDIC( \It{This will be completed someday.} ^^)character!set!EBCDIC) \appendix P: INDEX.[] The page numbers in the index for this manual can appear in a variety of fonts. These have the following meaning: $$\vbox{\halign{#\hfil&\ ---\ #\hfil\cr Roman&The keyword or phrase is {mentioned} here.\cr $\underline{\hbox{Roman}}$&$\underline{\hbox{Definition}}$ of concept or keyword.\cr {\bf boldfaced}&Reference to an entire {\bf topic}.\cr {\it italics}&An \It{example} is given.\cr} ^^{type|see{fonts}} \let\underline\relax \Wcon % Print table of contents.